package com.example.demo.mapper;


import com.example.demo.pojo.Catrgoryicon;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author yanglup
 * @create 2020-12-06 15:53
 */
@Mapper
public interface CategoryMapper {
    /**查询的分类列表*/
    @Select("select * from goodsfenleitable2")
    List<Catrgoryicon> Categoryicongonglist();
    /**算出总数量*/
    @Select("select count(*) from goodsfenleitable2;")
    Integer Catrgoryicongonglistnumber();

    /**修改1*/
    @Select("select * from goodsfenleitable2 where cat_id=#{cat_id}")
    Catrgoryicon Categoryicongongupdate(Integer cat_id);
    /**修改2*/
    @Update("update goodsfenleitable2 set cat_name=#{cat_name},cat_icon=#{cat_icon} where cat_id=#{cat_id};")
    void Categoryicongonglisttijiao(Integer cat_id, String cat_name, String cat_icon);

    /**查询名字*/
    @Select("select * from goodsfenleitable2 where cat_name=#{cat_name};")
    List<Catrgoryicon> Categoryicongonglistquery(String cat_name);
    /**查询页面数量*/
    @Select("select count(*) from goodsfenleitable2 where cat_name=#{cat_name};")
    Integer Categoryicongonglistquerynumber(String cat_name);

}
